<template>
  
	<div id="cashsuccess">

	    <yd-timeline>
	        <yd-timeline-item>
	            <p>系统处理中</p>
	            <p style="margin-top: 10px;"> 预计 {{enddate}} 到账</p>
	        </yd-timeline-item>
	        <yd-timeline-item>
	            <p>提现申请已发送</p>

	            <p style="margin-top: 10px;">
	            	<inline-loading v-if="cashLoginfo == undefined"></inline-loading>
	            	<span v-if="cashLoginfo != undefined">{{cashLoginfo.create_time}}</span>
	            </p>
	        </yd-timeline-item>
	    </yd-timeline>

	    <yd-preview class="mt20" :buttons="btns">
	        <yd-preview-header>
	            <div slot="left">提现金额</div>
	            <div slot="right">
	            	<inline-loading v-if="cashLoginfo == undefined"></inline-loading>
	            	<span v-if="cashLoginfo != undefined">¥{{cashLoginfo.price}}</span>
	            </div>
	        </yd-preview-header>

	        <!-- <yd-preview-item>
	            <div slot="left">费率</div>
	            <div slot="right">
	            	<inline-loading v-if="cashLoginfo == undefined"></inline-loading>
	            	<span v-if="cashLoginfo != undefined">{{cashLoginfo.sxf_rate}}</span>
	            </div>
	        </yd-preview-item>

	        <yd-preview-item>
	            <div slot="left">手续费</div>
	            <div slot="right">
	            	<inline-loading v-if="cashLoginfo == undefined"></inline-loading>
	            	<span v-if="cashLoginfo != undefined">¥{{cashLoginfo.sxf_price}}</span>
	            </div>
	        </yd-preview-item> -->
	        
	    </yd-preview>


	    <yd-button-group >
	        <yd-button @click.native="ok" size="large" type="primary">完成</yd-button>
	        <yd-button @click.native="cashloglist" size="large" type="hollow">明细</yd-button>
	    </yd-button-group>



	</div>


</template>

<script>

import { mapGetters } from 'vuex'

import { dateFormat, InlineLoading } from 'vux'

export default {
	name: 'Cashsuccess',
	data () {
		return {
			
			'btns': [
                
            ],
		}
	},

	components: {
	    InlineLoading,
	},

	computed : {
		...mapGetters([
			'company_code',
			'userdata',
			'cashLog',
		]),

		cashLoginfo () {
			return this.cashLog[0];
		},

		enddate () {
			if(this.cashLoginfo && this.cashLoginfo.create_time){
				var s = this.cashLoginfo.create_time;
				var e = dateFormat((new Date(s)).getTime() + 1000 * 60, 'YYYY-MM-DD HH:mm:ss')
				return e;
			}else{
				return '';
			}
		},
	},

	mounted () {

		this.$store.dispatch('getCashLog', {
			'code' : this.$route.query.code,
		});

	},

	methods : {
		ok () {
			this.$router.push({ 
				'name': 'account', 
				'query' : { 
					'company_code' : this.company_code,
				}
			});
		},

		cashloglist () {
			this.$router.push({ 
				'name': 'cashloglist', 
				'query' : { 
					'company_code' : this.company_code,
				}
			});
		},
	}
}
</script>

<style scoped>

</style>
